package com.topisv.tms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.PackformStyle;
import com.topisv.tms.repository.PackformStyleDao;

/**
 * 随箱单样式
 * @author Administrator
 *
 */
//Spring Bean的标识.
@Component
// 默认将类中的所有public函数纳入事务管理.
@Transactional(readOnly = true)
public class PackformStyleService {

	@Autowired
	private PackformStyleDao packformStyleDao;
	
	public List<PackformStyle> findByCustomerCode(String customerCode){
		return packformStyleDao.findByCustomerCode(customerCode);
	}
	
	@Transactional(readOnly = false)
	public void savePackformStyle(PackformStyle packformStyle){
		packformStyleDao.save(packformStyle);
	}
	@Transactional(readOnly = false)
	public void delete(Long arg0){
		packformStyleDao.delete(arg0);
	}
	public PackformStyle findOne(Long packformStyleId){
		return packformStyleDao.findOne(packformStyleId);
	}
	
	public Iterable<PackformStyle> findAll(){
		return packformStyleDao.findAll();
	}
	
}
